<template>
  <div>
    <secondary-page
      :themePic="themePic"
      :menuTitleBg = "menuTitleBg">
      <router-view></router-view>

      <!-- 文创 -->
      <div class="qr-wrap" v-if="oneLevelRouteName == 'Winchance'" slot="prompt">
        <img src="@/assets/images/Winchance/boyantang.jpg" width="" alt="" style="display:block">
        <p class="xui-text-center color-white xui-margin-top-xs">关注 "博衍堂" 二维码</p>
      </div>

      <!-- 学习 公告 -->
      <div class="notice-boardcast" v-if="oneLevelRouteName == 'study'" slot="prompt">
        <study-board></study-board>
      </div>

    </secondary-page>
  </div>
</template>

<script>
import SecondaryPage from "@/layout/secondary-page";
import defaultThemePic from "@/assets/images/example/theme.png";
import collectionPic from "@/assets/images/layout/collection-theme.jpg";
import culturePic from "@/assets/images/layout/culture-theme.jpg";
import displayPic from "@/assets/images/layout/display-theme.jpg";
import learningPic from "@/assets/images/layout/learning-theme.jpg";
import menuTitleBg from "@/assets/images/example/secondary-page-title-bg.png";
import studyBoard from "./widge/study-board";

export default {
  data() {
    return {
      defaultThemePic,
      collectionPic,
      culturePic,
      displayPic,
      learningPic,
      menuTitleBg
    };
  },
  components: {
    "secondary-page": SecondaryPage,
    studyBoard
  },
  computed: {
    themePic() {
      let result = this.collectionPic;
      let route = this.$route.matched[0].name;
      switch (this.oneLevelRouteName) {
        case "Collection":
          return this.collectionPic;
          break;
        case "Winchance":
          return this.culturePic;
          break;
        case "Exhibition":
          return this.displayPic;
          break;
        case "study":
          return this.learningPic;
          break;
        default:
          return this.defaultThemePic;
      }
    },
    oneLevelRouteName() {
      return this.$route.matched[0].name;
    },
    getStudyNotice() {}
  },
  filters: {
    oneLevelRouteName: function(value) {
      if (value == "study") {
        // 公告接口
      }
    }
  }
};
</script>

<style lang="less" scoped>
.qr-wrap {
  padding: 10px;
  background: #d3af68;
}
</style>


